const mongoose = require('mongoose');
//添加幻灯片信息
module.exports.admsg3=async function(addata){
    const data=await mongoose.model("addModel").create(addata);   
    return data;
};
//获取幻灯片信息
module.exports.getad3=async function({pagesize,pageone}){
    const das = await mongoose.model("addModel").countDocuments()
    const datas=await mongoose.model("addModel").find()
    .limit(pagesize-0).skip((pageone-1)*pagesize);
    const all={das,datas}
    return all;
  
}
//删除幻灯片信息
module.exports.delet3=async function(deletdata){
    const data=await mongoose.model("addModel").deleteOne(deletdata);
    return data;
  
}
//修改信息---查找信息
module.exports.findone3=async function(getdata){
    const data=await mongoose.model("addModel").find(getdata);
    return data;
  
}
//修改信息
module.exports.cgone3=async function({_id,add_name,add_img,add_http,add_msg}){
   const data=await mongoose.model("addModel").updateOne({_id},{add_name,add_img,add_http,add_msg});
   return data;
}